<html>
        <head>
            <title>数组按位置授权样例</title>
        </head>
        <body onload="javascript:init()">
              <form id="frm">
                位置1：<select id="slt1"><option value="1">集团</option><option value="2">省级</option><option value="3">地市级</option></select></br>
                位置2：<select  id="slt2"><option value="1">集团</option><option value="2">省级</option><option value="3">地市级</option></select></br>
                位置3：<select  id="slt3"><option value="1">集团</option><option value="2">省级</option><option value="3">地市级</option></select></br>
                位置4：<select  id="slt4"><option value="1">集团</option><option value="2">省级</option><option value="3">地市级</option></select></br>
            <input type="button" value="保存" onclick="javascript:saveSetting();"> 
              </form>  
              <script type="text/javascript">
              var path = "root.pageBlocks.A4GAd.pageFragments";
              var arraySize = 4;
              function init(){                    
                    var loc = document.location.href;   //like: xxx.html?path=xxxx&arraySize=4;
                    //获得path和arraySize；
                    //生成设置界面；
              }

              function saveSetting(){
                var ret ={};
                for(var i=0;i<arraySize;i++){
                    var ctl = document.getElementById("slt"+(i+1));
                    if(ctl){
                        var slted = ctl.options[ctl.selectedIndex].value;
                            ret[i] = slted;
                    }
                }
                if(window.opener){ 
                    opener.assignByIndexCallback(path,ret);
                }
                window.close();
              }
              </script>

        </body>
</html>